package com.pingan.haofang.searchcloud.common.constants;

/**
 * 通用的常量
 *
 * @author ZHANGBI617
 * @date 2017/3/22
 * @since 1.0.0
 */
public class Constants {

    /**
     * 后端允许的最大单页查询记录数
     */
    public static final int MAX_PAGE_SIZE = 50000;

    /**
     * REQUEST_ID,自己生成 在batch中为progressId
     */
    public static final String REQUEST_ID = "REQUEST_ID";

    /**
     * TRACE_ID,客户端发送,方便排查
     */
    public static final String TRACE_ID = "TRACE_ID";


    /**
     * 默认不限流
     */
    public static final int MAX_RATE_NOT_LIMIT = -1;

    /**
     * 默认限流200QOPS
     * TODO:这个值后续再评估下
     */
    public static final int MAX_RATE_DEFAULT = 2000;

    /**
     * pageSize
     */
    public static final int PAGE_SIZE = 1000;

    /**
     * 变量定义的正则pattern
     */
    public static final String NAME_PATTERN = "^[A-Za-z][A-Za-z0-9_]+$";

    /**
     * 索引名称正则pattern
     *
     * 由于Solr原生Sql不支持大写的collection，所以不要用大写
     */
    public static final String INDEX_NAME_PATTERN = "^[a-z][a-z0-9_]+$";

    /**
     * method变量名
     */
    public static final String METHOD_PATTERN = "^[A-Za-z][\\\\A-Za-z0-9_\\.]+$";

    /**
     * 时间格式化 pattern
     */
    public static final String DATE_FORMAT_YYYYMMDD ="yyyyMMdd";

    public static final String YYYY_MM_DD_HH_MM_SS  ="yyyy-MM-dd HH:mm:ss";


    public static final String CLOUD_REPORT_MAIL_TITLE = "searchcloud使用情况统计";
    public static final String CONFIG_REPORT_MAIL_TITLE = "无效config监控";
    public static final String FULL_IMPORT_REPORT_MAIL_TITLE = "全量导入报表";
    public static final String FULL_IMPORT_FAIL_REPORT_MAIL_TITLE = "全量导入失败通知";
    public static final String FULL_IMPORT_SUCCESS_REPORT_MAIL_TITLE = "全量导入成功通知";
    /**
     * report 邮件模板
     * 【环境】 标题-日期
     */
    public static final String REPORT_TEMPLATE_MAIL_TITLE = "【搜索云】【%s】%s-%s";


    /**
     * 分隔符
     */
    public static final String SPLITOR = ",";

}
